#pragma once
#ifndef GLOBAL_PARA_LEP 
#define GLOBAL_PARA_LEP
#include "TStyle.h"
#include <string> 
#include <vector>
#include "yaml-cpp/yaml.h"

#include "src/Lib/MessageFormat.h"
#include "src/Function/Fbasic.h"
#include "src/RWpara/RWbasic.h"
#include "src/Class/kinematic.h"
#include "src/Class/Path.h"
#include "src/Class/Lepton_Detector_Cut.h"

class CLepton_cut: public CENERGY, public CCHARGE, public CPT, public CETA, public CTHETA, public CCONE_LEP, public CCONE_JET , public CCONE_PHOTON, public CLepton_Detector_Cut{
	private:
	public:
		int     CUT_num           ;
		bool    SWITCH            ;

		inline CLepton_cut operator = (const CLepton_cut& L1); 
};


inline CLepton_cut CLepton_cut::operator = (const CLepton_cut& L1){
	this->PLOT_e     =L1.PLOT_e    ;
	this->PLOT_pt    =L1.PLOT_pt   ;
	this->PLOT_eta   =L1.PLOT_eta  ;
	this->PLOT_r_lep =L1.PLOT_r_lep;

	this->MinTrackEnergy            =L1.MinTrackEnergy             ;
	this->MaxTrackEnergy            =L1.MaxTrackEnergy             ;
	this->MinEnergyDepositByMomentum=L1.MinEnergyDepositByMomentum ;
	this->MaxEnergyDepositByMomentum=L1.MaxEnergyDepositByMomentum ;
	this->MinEcalToHcalFraction     =L1.MinEcalToHcalFraction      ;
	this->MaxEcalToHcalFraction     =L1.MaxEcalToHcalFraction      ;
	this->MinEyoke                  =L1.MinEyoke                   ;
	this->MaxEyoke                  =L1.MaxEyoke                   ;

	this->MinD0                     =L1.MinD0                      ;
	this->MaxD0                     =L1.MaxD0                      ;
	this->MinZ0                     =L1.MinZ0                      ;
	this->MaxZ0                     =L1.MaxZ0                      ;
	this->MinR0                     =L1.MinR0                      ;
	this->MaxR0                     =L1.MaxR0                      ;
	this->MinD0Sig                  =L1.MinD0Sig                   ;
	this->MaxD0Sig                  =L1.MaxD0Sig                   ;
	this->MinZ0Sig                  =L1.MinZ0Sig                   ;
	this->MaxZ0Sig                  =L1.MaxZ0Sig                   ;
	this->MinR0Sig                  =L1.MinR0Sig                   ;
	this->MaxR0Sig                  =L1.MaxR0Sig                   ;

	this->cosConeAngle              =L1.cosConeAngle               ;


	this->CUT_num=L1.CUT_num;
	this->ISOLATE_cone_lep          =L1.ISOLATE_cone_lep        ;
	this->ISOLATE_cone_had          =L1.ISOLATE_cone_had        ;
	this->ISOLATE_cone_photon       =L1.ISOLATE_cone_photon     ;
	this->ISOLATE_coef_lep          =L1.ISOLATE_coef_lep        ;
	this->ISOLATE_coef_had          =L1.ISOLATE_coef_had        ;
	this->ISOLATE_coef_photon       =L1.ISOLATE_coef_photon     ;
	this->ISOLATE_remainder_photon  =L1.ISOLATE_remainder_photon;
	this->ISOLATE_min_pt            =L1.ISOLATE_min_pt          ;

	for(int i=0;i<this->CUT_num;i++){
		this->JCUT_c                = L1.JCUT_c       ;
		this->CUT_c                 = L1.CUT_c        ;

		this->JCUT_e                = L1.JCUT_e       ;
		this->CUT_ed                = L1.CUT_ed       ;
		this->CUT_eu                = L1.CUT_eu       ;

		this->JCUT_pt               = L1.JCUT_pt      ;
		this->CUT_ptd               = L1.CUT_ptd      ;
		this->CUT_ptu               = L1.CUT_ptu      ;

		this->JCUT_theta            = L1.JCUT_theta   ;
		this->CUT_thetad            = L1.CUT_thetad   ;
		this->CUT_thetau            = L1.CUT_thetau   ;

		this->JCUT_eta              = L1.JCUT_eta     ;
		this->CUT_etad              = L1.CUT_etad     ;
		this->CUT_etau              = L1.CUT_etau     ;

		this->JCUT_r_lep            = L1.JCUT_r_lep   ;
		this->CUT_cone_lep          = L1.CUT_cone_lep ;
		this->CUT_cone_elec         = L1.CUT_cone_elec;
		this->CUT_cone_muon         = L1.CUT_cone_muon;
		this->CUT_cone_tau          = L1.CUT_cone_tau ;
	}

	return(*this);

}


class CLepton{
	private:
	public:
		bool    SWITCH            ;
		bool    PLOT              ;

    	CLepton_cut basic_elec ;
    	CLepton_cut basic_muon ;

		CLepton_cut lep  ;
		CLepton_cut elec ;
		CLepton_cut muon ;
		CLepton_cut tau  ;

		void Read_Lepton(CPath path);
		void Read_Lepton_particle(CPath path,std::string particle_name, CLepton_cut &lep, bool flag_detector);

};

#endif
